//
//  ConnectionMsg.swift
//  NetAction
//
//  Created by zcj on 2024/12/30.
//  description 实现对于connection以及相关数据的存放，子类继承并实现相关功能

import Foundation
import Network
public protocol ConnectionProtocol{
    func update()
}

public class ConnectionMsg:ConnectionProtocol{
    
    //初始化
    let con:NWConnection
    var timeStamp:TimeInterval = Date().timeIntervalSince1970
    public var lastData:Data = Data()
    
    init(con: NWConnection) {
        self.con = con
    }
    
    public func update() {
        //更新数据
        //更新最后一次通信的时间
        timeStamp = Date().timeIntervalSince1970
    }
}
